#include<bits/stdc++.h>
using namespace std;
int t[100010],n,st[100010],a,maxx,killed;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a;
		maxx=max(a,maxx);
		t[a]++;
		st[a]++;
	}
	//sort(r,r+n);
	for(int i=1;i<=maxx;i++){
		for(int j=i+1;j<=maxx;j++){
			if(st[j]>=t[i]){
				//cout<<i<<" "<<j;
				st[j]-=t[i];
				killed+=t[i];
				t[i]=0;
				
				break;
			}else{
				t[i]-=st[j];
				killed+=st[j];
				st[j]=0;
			}
		}
	}
	cout<<n-killed;
	return 0;
}
